<%-- 
    Document   : visitProfile
    Created on : Jul 11, 2011, 4:28:51 PM
    Author     : northpole
--%>

<%@page import="user.User" contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
   "http://www.w3.org/TR/html4/loose.dtd">

<html>
    <head>
        <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
        <title>JSP Page</title>
    </head>
    <body>
        <h1><%if(request.getParameter("username")==null)
            out.print("how did u get here");
        else
            out.print(request.getParameter("username"));
        %>'s Page</h1>
        <h2><%if(session.getAttribute("username")!=null)
            out.print(session.getAttribute("username").toString());
        else out.println("Visitor");%></h2>>
        <%
        User u=new User();
        String []info=new String[5];
        u.setUsername(session.getAttribute("username").toString());
        if(session.getAttribute("username")!=null)
                  { info=u.loadInfo(request.getParameter("username").toString());
                   
               }else
            info= u.loadInfo("Visitor");
 //prpei na valw elegxo gia is friend is not friend klp
         out.print(info[3]);
/* out.print("Name "+info[0]+"</br>");
  out.print("Surname "+info[1]+"</br>");
 out.print("Was Born On  "+info[2]+"</br>");

 out.print("Interests "+info[3]+"</br>");
 out.print("Welcome Text "+info[4]+"</br>");
*/
%>
<a href="addFriend.jsp?username=<%out.print(u.getUsername());%> &id=3">addfriend</a>
<a href="endSession.jsp">logout</a>
    </body>
</html>
